package collection.map;

import java.util.*;

public class OperationMap {
    private Map<String, Set<String>> rightMap = null;

    public OperationMap(Map<String, Set<String>> rightMap) {
        this.rightMap = rightMap;
    }

    public void addRight(String rigthKey, Set<String> rightValues) {

        Set<String> orgiRightSet = this.rightMap.get(rigthKey);

        if (orgiRightSet == null || (orgiRightSet.isEmpty())) {
            this.rightMap.put(rigthKey, rightValues);
        } else {
            orgiRightSet.addAll(rightValues);

            this.rightMap.put(rigthKey,orgiRightSet);
        }
    }

    @Override
    public String toString(){
        return rightMap.toString();
    }





}
